

using System;
using System.Data;
using System.IO;
using System.Linq;
using System.Linq.Dynamic;
using System.Linq.Expressions;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using Abp.Linq;
using Abp.Linq.Extensions;
using Abp.Extensions;
using Abp.UI;
using Abp.Domain.Repositories;
using Abp.Domain.Services;

using Yozeev;
using Yozeev.BusinessLogic;


namespace Yozeev.BusinessLogic.DomainService
{
    /// <summary>
    /// TicketPrice领域层的业务管理
    ///</summary>
    public class TicketPriceManager :YozeevDomainServiceBase, ITicketPriceManager
    {
		
		private readonly IRepository<TicketPrice,Guid> _repository;

		/// <summary>
		/// TicketPrice的构造方法
		///</summary>
		public TicketPriceManager(
			IRepository<TicketPrice, Guid> repository
		)
		{
			_repository =  repository;
		}


		/// <summary>
		/// 初始化
		///</summary>
		public void InitTicketPrice()
		{
			throw new NotImplementedException();
		}

		// TODO:编写领域业务代码

		//
		public List<TicketPrice> GetTicketPriceList()
		{
			//获取缓存中的销售源
			//var list = _repository.GetAll().ToList();
            var list = from ticketPrice in _repository.GetAll().AsNoTracking()
                       select new { ticketPrice, ticketPrice.Ticket }
                      ;
            var ticketPriceList = new List<TicketPrice>();
            list.ToList().ForEach(t => {
                var ticketPrice = t.ticketPrice;
                ticketPrice.Ticket = t.Ticket;
                ticketPriceList.Add(ticketPrice);
            });
            return ticketPriceList;
		}






	}
}
